use std::result;
use thiserror::Error;

#[derive(Error,Debug)]
pub enum Errors{
    #[error{"failed to read from data file"}]
    FailedToReadDataFile,
    #[error{"failed to write to data file"}]
    FailedToWriteDataFile,
    #[error{"failed to sync data file"}]
    FailedToSyncDataFile,
    #[error{"failed to close data file"}]
    FailedToCloseDataFile,
    #[error{"failed to open data file"}]
    FailedToOpenDataFile,
    #[error{"key is empty"}]
    KeyIsEmpty,
    #[error{"memory index failed to update"}]
    IndexUpdateFailed,
    #[error{"key not found in databases"}]
    KeyNotFound,
    #[error{"data file not found in databases"}]
    DataFileNotFound,
    
}
pub type Result<T> = result::Result<T, Errors>;